/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: mirac
 * Date: 2025-04-17
 * Time: 16:02
 */

public class main {
    public static void main(String[] args) {
        int count = 0; //统计个数

        for (int i = 1; i <= 100; i++){
            //  对每一位进行判断，是不是为数字9，如果是count++；
            int x = i;
            while(x != 0 ){
                if(x % 10 == 9){
                    count++;
                }
                x /= 10;
            }
        }
        System.out.println("1-100之间数字9出现的次数为：");
        System.out.println(count);
    }
}
